import request from '@/utils/request';

/**
 * 商户协议 列表
 */
export function agreementListApi(params) {
  return request({
    url: '/admin/platform/agreement/list',
    method: 'get',
    params,
  });
}

/**
 * 商户协议 添加
 */
export function agreementAddApi(data) {
  return request({
    url: '/admin/platform/agreement/add',
    method: 'post',
    data,
  });
}

/**
 * 商户协议 添加
 */
export function agreementUpdateApi(data) {
  return request({
    url: '/admin/platform/agreement/update',
    method: 'post',
    data,
  });
}

/**
 * 商户协议 关闭
 */
export function agreementCloseApi(id) {
  return request({
    url: `/admin/platform/agreement/close/${id}`,
    method: 'post',
  });
}

/**
 * 商户协议 详情
 */
export function agreementDetailApi(id) {
  return request({
    url: `/admin/platform/agreement/detail/${id}`,
    method: 'get',
  });
}

/**
 * 商户协议 开启
 */
export function agreementOpenApi(id) {
  return request({
    url: `/admin/platform/agreement/open/${id}`,
    method: 'post',
  });
}

/**
 * 商户协议分页列表表头数量
 * @param data
 */
export function agreementHeaderNumApi(params) {
  return request({
    url: `/admin/platform/agreement/list/header/num`,
    method: 'get',
    params,
  });
}
